const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const {xe} = require("../../tools/tool");
const router = new Router();
// 换算购物车
router.post('/app/changeCart', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId
    let id = ctx.request.body.id
    let qty = ctx.request.body.qty
    let model = await db.models['cart'].findOne({
        where: {
            tenantId,
            id
        }
    })
    model.qty = qty
    await model.save()

    return ctx.suc('')
})

module.exports = router;
